package com.ruoyi.project.museum.type.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.museum.type.mapper.ExhibitTypeMapper;
import com.ruoyi.project.museum.type.domain.ExhibitType;
import com.ruoyi.project.museum.type.service.IExhibitTypeService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 文物类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-10
 */
@Service
public class ExhibitTypeServiceImpl implements IExhibitTypeService 
{
    @Autowired
    private ExhibitTypeMapper exhibitTypeMapper;

    /**
     * 查询文物类型
     * 
     * @param id 文物类型ID
     * @return 文物类型
     */
    @Override
    public ExhibitType selectExhibitTypeById(Integer id)
    {
        return exhibitTypeMapper.selectExhibitTypeById(id);
    }

    /**
     * 查询文物类型列表
     * 
     * @param exhibitType 文物类型
     * @return 文物类型
     */
    @Override
    public List<ExhibitType> selectExhibitTypeList(ExhibitType exhibitType)
    {
        return exhibitTypeMapper.selectExhibitTypeList(exhibitType);
    }

    /**
     * 新增文物类型
     * 
     * @param exhibitType 文物类型
     * @return 结果
     */
    @Override
    public int insertExhibitType(ExhibitType exhibitType)
    {
        exhibitType.setCreateTime(DateUtils.getNowDate());
        return exhibitTypeMapper.insertExhibitType(exhibitType);
    }

    /**
     * 修改文物类型
     * 
     * @param exhibitType 文物类型
     * @return 结果
     */
    @Override
    public int updateExhibitType(ExhibitType exhibitType)
    {
        exhibitType.setUpdateTime(DateUtils.getNowDate());
        return exhibitTypeMapper.updateExhibitType(exhibitType);
    }

    /**
     * 删除文物类型对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteExhibitTypeByIds(String ids)
    {
        return exhibitTypeMapper.deleteExhibitTypeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除文物类型信息
     * 
     * @param id 文物类型ID
     * @return 结果
     */
    @Override
    public int deleteExhibitTypeById(Integer id)
    {
        return exhibitTypeMapper.deleteExhibitTypeById(id);
    }
}
